﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using PhanMemDoVui.DataAccess;
using System.Windows.Forms;

namespace PhanMemDoVui.BusinessLogic
{
    class ScoreBUS
    {
        private DataTable diemThi;
        public DataTable LietKeDiemThi()
        {
            ConnectData da = new ConnectData();
            string sql = "Select distinct Profile, Score From Exam Where Ended = 'Yes' Order by Score DESC, Profile DESC";
            return da.GetDataTable(sql);
        }
        public bool CapNhat(int diem, int maExam)
        {
            ConnectData da = new ConnectData();
            string update = "Update Exam Set Score = Score + " + diem.ToString() + " Where Ma = " + maExam.ToString();
            return da.ExecuteNonQuery(update);
        }
    }
}
